﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using padnug.Domain;
using PadnugRepository;

namespace PadnugService
{
    public class PadnugEventsService : IPadnugEventsService
    {
        private PadnugEventsRepository repository;
        public PadnugEventsService()
        {
            repository = new PadnugEventsRepository();
        }
        #region IPadnugEventsService Members

        public Event GetEvent(int Id)
        {
            return repository.GetEvent(Id);
        }

        public IList<Event> GetEvents(int? skip, int? take)
        {
            return repository.GetEvents(skip, take);
        }

        public IList<Event> GetEventsForADate(DateTime eventDate)
        {
            return repository.GetEventsForADate(eventDate);
        }

        public Event GetFeaturedEvent()
        {
            return repository.GetFeaturedEvent();
        }

        public IList<Event> GetUpcomingEvents()
        {
            return repository.GetUpcomingEvents();
        }

        public bool SaveEvent(Event padnugEvent)
        {
            return repository.SaveEvent(padnugEvent);
        }

        public bool UpdateEvent(Event padnugEvent)
        {
            return repository.UpdateEvent(padnugEvent);
        }

        public bool DeleteEvent(int eventId)
        {
            return repository.DeleteEvent(eventId);
        }

        public IList<DateTime> GetEventsForMonth(DateTime firstDayOfMonth)
        {
            return repository.GetEventsForMonth(firstDayOfMonth);
        }

        #endregion
    }

    public interface IPadnugEventsService
    {
        Event GetEvent(int Id);
        IList<Event> GetEvents(int? skip, int? take);
        IList<Event> GetEventsForADate(DateTime eventDate);
        Event GetFeaturedEvent();
        IList<Event> GetUpcomingEvents();
        bool SaveEvent(Event padnugEvent);
        bool UpdateEvent(Event padnugEvent);
        bool DeleteEvent(int eventId);
        IList<DateTime> GetEventsForMonth(DateTime firstDayOfMonth);
    }
}
